package com.sxt.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sxt.system.domain.User;
import com.sxt.system.mapper.UserMapper;
import com.sxt.system.service.UserService;
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService{

    @Override
    public User queryUserByLoginName(String loginName) {
        if(!StringUtils.isNotBlank(loginName)){
            log.error("用户登陆名不能为空");
            return null;
        }else {
            QueryWrapper<User> qw=new QueryWrapper<>();
            qw.eq("loginname",loginName);
            User user = this.baseMapper.selectOne(qw);
            return user;
        }
    }
}
